package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCgImportMainDetailMapper;
import com.ruoyi.system.domain.SysCgImportMainDetail;
import com.ruoyi.system.service.ISysCgImportMainDetailService;

/**
 * SysCgImportMainDetailService业务层处理
 * 
 * @author SYF
 * @date 2025-05-15
 */
@Service
public class SysCgImportMainDetailServiceImpl implements ISysCgImportMainDetailService 
{
    @Autowired
    private SysCgImportMainDetailMapper sysCgImportMainDetailMapper;


    /**
     * 查询SysCgImportMainDetail列表
     * 
     * @param sysCgImportMainDetail SysCgImportMainDetail
     * @return SysCgImportMainDetail
     */
    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<SysCgImportMainDetail> selectSysCgImportMainDetailList(SysCgImportMainDetail sysCgImportMainDetail)
    {
        return sysCgImportMainDetailMapper.selectSysCgImportMainDetailList(sysCgImportMainDetail);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<SysCgImportMainDetail> selectCgImportDetailList(SysCgImportMainDetail sysCgImportMainDetail)
    {
        return sysCgImportMainDetailMapper.selectCgImportDetailList(sysCgImportMainDetail);
    }

    /**
     * 新增SysCgImportMainDetail
     * 
     * @param sysCgImportMainDetail SysCgImportMainDetail
     * @return 结果
     */
    @Override
    public int insertSysCgImportMainDetail(SysCgImportMainDetail sysCgImportMainDetail)
    {
        sysCgImportMainDetail.setCreateTime(DateUtils.getNowDate());
        return sysCgImportMainDetailMapper.insertSysCgImportMainDetail(sysCgImportMainDetail);
    }

    /**
     * 修改SysCgImportMainDetail
     * 
     * @param sysCgImportMainDetail SysCgImportMainDetail
     * @return 结果
     */
    @Override
    public int updateSysCgImportMainDetail(SysCgImportMainDetail sysCgImportMainDetail)
    {
        sysCgImportMainDetail.setUpdateTime(DateUtils.getNowDate());
        return sysCgImportMainDetailMapper.updateSysCgImportMainDetail(sysCgImportMainDetail);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectDepts(String year){
        return sysCgImportMainDetailMapper.selectDepts(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectSales(String year){
        return sysCgImportMainDetailMapper.selectSales(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectCustomer(String year){
        return sysCgImportMainDetailMapper.selectCustomer(year);
    }
}
